package cn.txy.service.impl;

import cn.txy.domain.OpenIdResult;
import cn.txy.result.JSONResult;
import cn.txy.service.IWechatRegisterService;
import cn.txy.template.WechatLoginTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class WechatRegisterServiceImpl implements IWechatRegisterService {
    @Autowired
    private WechatLoginTemplate wechatLoginTemplate;

    @Override
    public JSONResult<OpenIdResult> getOpenId(String code) {
        OpenIdResult openId = wechatLoginTemplate.getOpenId(code);
        return JSONResult.success(openId);
    }
}

